<template>
	<!-- 分类页 -->
	<view class="classify pageBg">
		<custom-nav-bar title="分类"></custom-nav-bar>
		<view class="classify-content">
			<theme-item v-for="item in classifyList" :item="item"></theme-item>
		</view>
	</view>
</template>

<script setup>
	import {
		onLoad
	} from '@dcloudio/uni-app'
	import {
		getClassifyApi
	} from '../../api/apis';
	import {
		ref
	} from 'vue';
	const classifyList = ref([])

	async function getClassifyData() {
		// 最多15个分类
		const res = await getClassifyApi({
			pageSize: 15
		})
		classifyList.value = res.data
	}

	onLoad(async () => {
		await getClassifyData()
	})
</script>

<style lang="scss" scoped>
	.classify {
		&-content {
			padding: 30rpx;
			display: grid;
			grid-template-columns: repeat(3, 1fr);
			gap: 15rpx;
		}
	}
</style>